package com.love.marriage.common.vo;

import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.love.marriage.config.Long2StringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.time.LocalDateTime;

@EqualsAndHashCode(callSuper = true)
@Data
public class BaseVo<T extends Model<T>> extends Model<T> implements Serializable {

    @Schema(description = "id", type = "Long", implementation = Long.class)
    @JsonSerialize(using = Long2StringSerializer.class)
    private Long id;

    @JsonSerialize(using = Long2StringSerializer.class)
    @Schema(description = "创建人", type = "Long", implementation = Long.class, hidden = true)
    private Long creator;

    @Schema(description = "创建时间", implementation = LocalDateTime.class, hidden = true)
    private LocalDateTime createTime;

    @JsonSerialize(using = Long2StringSerializer.class)
    @Schema(description = "操作人", type = "Long", implementation = Long.class)
    private Long operator;

    @Schema(description = "操作时间", implementation = LocalDateTime.class)
    private LocalDateTime operateTime;

    @Schema(description = "删除人", type = "Long", implementation = Long.class, hidden = true)
    private Long deleter;

    @Schema(description = "删除时间", implementation = LocalDateTime.class, hidden = true)
    private LocalDateTime deleteTime;

    @Schema(description = "是否删除", type = "Integer", implementation = Integer.class, hidden = true)
    private Integer deleteFlag;
}
